<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>

    </style>
    <script src="Itcast.core.js"></script>
</head>
<body>
<div>
    <p>1</p>
    <p class="c">2</p>
    <p class="d">3</p>
    <p>ppp</p>
</div>
<div>
    <p>4</p>
    <p class="c">5</p>
</div>
<ul>
    <p class="c">6</p>
    <p>7</p>
</ul>
<script>
    var length = I( 'p' ).parent().each(function () {
        this.style.border = '1px dashed red';
    }).length;

    console.log( length );

</script>
</body>
</html>